
/**
 * 格式化url参数
 *
 * @export
 * @param {string} url
 * @returns
 */
export function parseQuery(url: string) {
  const params: any = {};
  const query = url.split("?")[1];
  const queryArr = query.split("&");
  queryArr.forEach(item => {
    const key = item.split("=")[0];
    const value = item.split("=")[1];
    params[key] = decodeURI(value);
  });
  return params;
}